﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MySQLStudio.BusinessLogic
{
    public class Host
    {
        private string m_hostname;       
        private int m_portNumber;        
        private string m_username;        
        private string m_password;       

        public string Hostname
        {
            get { return m_hostname; }
            set { m_hostname = value; }
        }

        public int PortNumber
        {
            get { return m_portNumber; }
            set { m_portNumber = value; }
        }

        public string Username
        {
            get { return m_username; }
            set { m_username = value; }
        }

        public string Password
        {
            get { return m_password; }
            set { m_password = value; }
        }

        public string ConnectionString
        {
            get
            {
                return string.Format("Data Source={0};Port={1};Initial Catalog=INFORMATION_SCHEMA;User ID={2};Password={3};",
                                      this.m_hostname,
                                      Convert.ToString(this.m_portNumber),
                                      this.m_username,
                                      this.m_password);
            }
        }

        public Host()
        {
            this.m_hostname = String.Empty;
            this.m_portNumber = 0;
            this.m_username = String.Empty;
            this.m_password = String.Empty;
        }
        public Host(string hostname, int portNumber, string username, string password)
        {
            this.m_hostname = hostname;
            this.m_portNumber = portNumber;
            this.m_username = username;
            this.m_password = password;
        }
    }
}
